{% extends 'layout/base.html' %}
{% load static %}
{% block content %}
<div class="container-fluid">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <ul class="nav nav-tabs page-tabs">
                    <li><a href="{% url 'wx_official:edit_org' org.id %}">基本信息</a></li>
                    <li class="active"><a href="{% url 'wx_official:article_org' org.id 1 %}">文章列表</a></li>
                </ul>
                <div class="card">
                    <div class="card-toolbar clearfix">
                        <form class="pull-right search-bar" method="get" action="" role="form">
                            <div class="input-group">
                                <div class="input-group-btn">
                                    <input type="hidden" name="search_field" id="search-field" value="title">
                                    <button class="btn btn-default dropdown-toggle" id="search-btn"
                                            data-toggle="dropdown" type="button" aria-haspopup="true"
                                            aria-expanded="false">
                                        筛选 <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu">
                                        <li><a tabindex="-1" href="{% url 'wx_official:article_org' org.id 1  %}?sort=desc&include=" data-field="title">默认(倒序显示所有)</a></li>
                                        <li><a tabindex="-1" href="{% url 'wx_official:article_org' org.id 1  %}?sort=asc&include=">时间生序</a></li>
                                        <li><a tabindex="-1" href="{% url 'wx_official:article_org' org.id 1  %}?sort=&include=is_spider" data-field="cat_name">已完成</a>
                                        </li>
                                        <li><a tabindex="-1" href="{% url 'wx_official:article_org' org.id 1  %}?sort=&include=no_spider" data-field="cat_name">未完成</a>
                                        </li>
                                    </ul>
                                </div>
                                <input type="text" class="form-control" value="" name="keyword" placeholder="请输入名称">
                            </div>
                        </form>
                        <div class="toolbar-btn-action">
                            <img src="{{ org.logo_url }}" alt="" style="width: 30px">
                            <button type="button" class="btn btn-info" data-whatever="@mdo"><i class="mdi mdi-more"></i>
                                机构名：{{ org.org_name }}
                            </button>
                        </div>
                    </div>
                    <div class="card-body">

                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>
                                        <label class="lyear-checkbox checkbox-primary">
                                            <input type="checkbox" id="check-all"><span></span>
                                        </label>
                                    </th>
                                    <th>编号</th>
                                    <th>标题</th>
                                    <th>作者</th>
                                    <th>梗概</th>
                                    <th>发布时间</th>
                                    <th>抓取时间</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for index in skus_page %}
                                <tr>
                                    <td>
                                        <label class="lyear-checkbox checkbox-primary">
                                            <input type="checkbox" name="ids[]" value="1"><span></span>
                                        </label>
                                    </td>
                                    <td>{{ index.id }}</td>
                                    <td><a href="{{ index.article_link }}">{{ index.title }}</a></td>
                                    <td>{{ index.article_author }}</td>
                                    <td width="20%">{{ index.article_desc }}</td>
                                    <td>{{ index.article_create_on }}</td>
                                    <td>{{ index.update_time }}</td>

                                    <td><font class="text-success">
                                        {% if index.spidered == 1 %}已完成
                                        {% else %}未完成
                                        {% endif %}

                                    </font></td>
                                    <td>
                                        <div class="btn-group">
                                            <a class="btn btn-xs btn-default" href="#!" title="" data-toggle="tooltip"
                                               data-original-title="编辑"><i class="mdi mdi-pencil"></i></a>
                                            <a class="btn btn-xs btn-default" href="#!" title="" data-toggle="tooltip"
                                               data-original-title="删除"><i class="mdi mdi-window-close"></i></a>
                                        </div>
                                    </td>
                                </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                        <ul class="pagination">
                            {% if skus_page.has_previous %}
                            <li>
                              <span><a href="{% url 'wx_official:article_org' org.id skus_page.previous_page_number %}?sort={{ sort }}&include={{ include }}">«</a></span>
                            </li>
                            {% endif %}
                            {% for pindex in pages %}
                            {% if pindex == skus_page.number %}
                            <li class="active"><a href="{% url 'wx_official:article_org' org.id pindex %}?sort={{ sort }}&include={{ include }}"><span>{{ pindex }}</span></a>
                            </li>

                            {% else %}
                            <li>
                                <a href="{% url 'wx_official:article_org' org.id pindex %}??sort={{ sort }}&include={{ include }}"><span>{{ pindex }}</span></a>
                            </li>

                            {% endif %}
                            {% endfor %}
                            {% if skus_page.has_next %}
                            <li>
                                <a href="{% url 'wx_official:article_org' org.id skus_page.next_page_number %}?sort={{ sort }}&include={{ include }}">»</a>
                            </li>
                            {% endif %}
                        </ul>

                    </div>
                </div>

            </div>
        </div>

    </div>

</div>
{% endblock %}